package com.xidian.zhiancloud.service.exam.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.xidian.zhiancloud.dao.exam.TTrainTypeMapper;
import com.xidian.zhiancloud.model.exam.TrainType;
import com.xidian.zhiancloud.service.exam.ITrainTypeService;

/**
 * 培训类型管理Service业务层处理
 * 
 * @author zhouweitao
 * @date 2021-03-16
 */
@Service
public class TrainTypeServiceImpl implements ITrainTypeService 
{
    @Autowired
    private TTrainTypeMapper trainTypeMapper;

    /**
     * 查询培训类型管理
     * 
     * @param id 培训类型管理ID
     * @return 培训类型管理
     */
    @Override
    public TrainType selectTrainTypeById(Long id)
    {
        return trainTypeMapper.selectTrainTypeById(id);
    }

    /**
     * 查询培训类型管理列表
     * 
     * @param trainType 培训类型管理
     * @return 培训类型管理
     */
    @Override
    public Page<TrainType> selectTrainTypeList(TrainType trainType)
    {
    	PageHelper.startPage(trainType.getPageNum()-1, trainType.getPageSize());
        return trainTypeMapper.selectTrainTypeList(trainType);
    }

    /**
     * 新增培训类型管理
     * 
     * @param trainType 培训类型管理
     * @return 结果
     */
    @Override
    public int insertTrainType(TrainType trainType)
    {
        return trainTypeMapper.insertTrainType(trainType);
    }

    /**
     * 修改培训类型管理
     * 
     * @param trainType 培训类型管理
     * @return 结果
     */
    @Override
    public int updateTrainType(TrainType trainType)
    {
        return trainTypeMapper.updateTrainType(trainType);
    }

    /**
     * 批量删除培训类型管理
     * 
     * @param ids 需要删除的培训类型管理ID
     * @return 结果
     */
    @Override
    public int deleteTrainTypeByIds(Long[] ids)
    {
        return trainTypeMapper.deleteTrainTypeByIds(ids);
    }

    /**
     * 删除培训类型管理信息
     * 
     * @param id 培训类型管理ID
     * @return 结果
     */
    @Override
    public int deleteTrainTypeById(Long id)
    {
        return trainTypeMapper.deleteTrainTypeById(id);
    }
}
